<%@ Page Culture="en-US" UICulture="en-US" Language="VB" Explicit="true" Debug="false"%>

<%@ OutputCache Location="None" VaryByParam="None" %>

<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>
<%@ Import Namespace="System.Data.OleDb" %>


<Script LANGUAGE="VB" runat="server">

  '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  ' To convert the SQL Server versions to MS Access do the following:-
  '   Replace the 2 DSN lines
  '   Replace all code of:-   SQLCommand   to   OleDbCommand
  '   Replace all code of:-   SQLDatareader   to   OleDbDatareader
  '   Replace Dates from '  to #  (do not need ' for SQL Server)  (eg strStartDate = "#" & strStartDate & "#")
  '   Change Function DateConvitfromformUS, also  (see comments in Function itself)
  '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  Public intSkipCount As Integer
  Public intTotalPages As Integer   'Total number of pages
  Public intPageSize As Integer  'records per page
  Public intCurrentPage As Integer   'Current page you are on 
  Public intTotalNoRecords As Long  'Total number of records in data source
  Public intRowID As Integer   'Current Row you are on
  Public strSortField As String
  Public strpageload, strAction, strInnerAction as string
  Public strDispTotals, strDispPageCounts, strDispPKID, strDataTable, strHeaderTable, strNavTable as String
  Public strbtnLastPage, strbtnFirstPage, strbtnPreviousPage, strbtnNextPage, strlblCurrentPage as String
  Public strarraysearch, strmachsearch, strPKID,  strDone, strcellvalue, strErrMsg as String
  Public blPageValid as Boolean

    Dim objConn As New SqlConnection(ConfigurationSettings.AppSettings("DSN"))   '.net 1.1
    'Dim objConn As New OleDbConnection(System.Configuration.ConfigurationManager.AppSettings("DSNmdb"))   '.net 2.0
    
  '=======================================================================================
  ' NOTE:-
  ' Code that can be Customised are marked by &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
  '
  '=======================================================================================


  Private Sub Page_Load()
   
            strAction=Request.QueryString("action")   'get action from another web page
           
            strPKID = Request.QueryString("num")
            strcellvalue=Request.QueryString("cellval")
            UpdateDBase()
               
            
             If blPageValid = false then
                     response.write(strErrMsg)
                     response.end
             Else
                   strDone = "Doneit!"
                   'response.write(strDone)
                   response.write("")    'pass back nothing
             End If


    End Sub


    '&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
    'Change as required
    '------------------------------------------------
    Sub UpdateDBase()
   
          Dim strSql as string
        Dim objCmd As SqlCommand
        Dim objRdr As SqlDataReader

          session.lcid=2057  '3081-AUS   1033-US   2057-BRITISH

          blPageValid = true

          If isdbnull(strcellvalue) or len(strcellvalue) = 0 then
            strErrMsg = "Error - Array_Name is required!"
            blPageValid = false
          End If

         strcellvalue = replace(strcellvalue,"'","''")    'so as to cope with any Apostrophes in text

          If blPageValid = true then

            strSql = "UPDATE ARRAYS2 SET Array_Name  ='" & strcellvalue & "'  " & _
                  " WHERE PK_ID = " & strPKID & ""

                  '================================================================================
                  'These next fields are needed for when checking in multi-user environment if a record has changed
                  'These fields should be default in every Table
                  '               
                  '                "LastUpdated ='" & FormatDateTime(now(),3)  & "', " & _
                  '                "RemoteUser ='" & Request.ServerVariables("REMOTE_ADDR")  & "', " & _
                  '                "AuthUser ='" & Request.ServerVariables("AUTH_USER")  & "', " & _
                  '================================================================================

            objCmd = New SqlCommand(strSql, objConn)

             objConn.Open()
             objCmd.ExecuteNonQuery()
             objConn.Close()

          End If


     End Sub
     '&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


</Script> 



<HTML>
<HEAD>

</HEAD>
<BODY>

<form id="form1" method="post" runat="server">

</form>

</BODY>
</HTML>


